/*
package com.work.count.util;


import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFRow;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

*/
/**
 * @author ex_renbaokun
 *//*

public class ReadXlsxExcel {
    @Autowired
    public WorkingDao workingDao;

    public static List<CsWorkingHours> readExcel(MultipartFile files) {
        String file = "E:\\原始表.xlsx";
        FileInputStream inputStream = null;
        try {
            inputStream = (FileInputStream) files.getInputStream();
        } catch (IOException e) {
            e.printStackTrace();
        }
        List list = new ArrayList();
        try {
           // FileInputStream fis = new FileInputStream(String.valueOf(inputStream));
            XSSFWorkbook sfs = new XSSFWorkbook(inputStream);
            //获取工作表数量
            int numberOfSheets = sfs.getNumberOfSheets();
            //循环所有的工作表
            for (int i = 0; i < numberOfSheets; i++) {
                XSSFSheet sheetAt = sfs.getSheetAt(i);
                int lastRowNum = sheetAt.getLastRowNum();
                XSSFRow row1 = sheetAt.getRow(2);
                //姓名
                String cell3 = row1.getCell(1).getStringCellValue();
                //工号
                Double cell8 = row1.getCell(3).getNumericCellValue();
                //部门
                XSSFCell cell9 = row1.getCell(9);
                int i1 = cell8.intValue();
                if (lastRowNum > 7) {
                    for (int j = 6; j < lastRowNum; j++) {

                        CsWorkingHours ck = new CsWorkingHours();
                        ck.setWorkerName(cell3+"");
                        ck.setWorkId(i1+"");
                        ck.setDepart(cell9+"");
                        XSSFRow row = sheetAt.getRow(j);
                        //日期
                        XSSFCell cell = row.getCell(0);
                        //cellType为3则为空
                        int cellType = cell.getCellType();
                        if (cellType == 3) {
                            break;
                        }
                        double v = Double.parseDouble(cell + "");
                        Date javaDate2 = HSSFDateUtil.getJavaDate(v);
                        ck.setCreateDate(javaDate2);
                        //工作时间
                        XSSFCell cell4 = row.getCell(1);
                        ck.setWorkTime(cell4+"");
                        //成本中心
                        XSSFCell cell5 = row.getCell(2);
                        ck.setIoNumber(cell5+"");
                        //机器名称
                        XSSFCell cell6 = row.getCell(3);
                        ck.setMachineName(cell6+"");
                        //设计工时
                        double numericCellValue2 = row.getCell(4).getNumericCellValue();
                        ck.setDisignTime(numericCellValue2);
                        //装配工时
                        double numericCellValue3 = row.getCell(5).getNumericCellValue();
                        ck.setAssemblyTime(numericCellValue3);
                        //调机工时
                        double numericCellValue4 = row.getCell(6).getNumericCellValue();
                        ck.setAllocateTime(numericCellValue4);
                        //累积工时
                        Double cell1 = row.getCell(7).getNumericCellValue();
                        ck.setSumHours(cell1);
                        // 工时、
                        XSSFCell cell2 = row.getCell(8);
                        double numericCellValue1 = cell2.getNumericCellValue();
                        ck.setWorkingHours(numericCellValue1);
                        //说明
                        XSSFCell cell7 = row.getCell(9);
                        ck.setInstructions(cell7+"");
                        //总工时
                        double numericCellValue5 = row.getCell(10).getNumericCellValue();
                        ck.setAllHours(numericCellValue5);
                        list.add(ck);
                    }
                }
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return list;
    }

    public static void main(String[] args) {
        Long time = new Long(1602748137974L);
        Date date = new Date(time);
        System.out.println(date);
    }
}
*/
